export function metrics() {
  return RSocket.rr({
    route: 'pay.stats.metrics',
  });
}

export function arDetailsByDay(args) {
  return RSocket.rs({
    route: 'pay.stats.ar-details.by-day',
    args,
  });
}

export function arDetailsByMonth(args) {
  return RSocket.rs({
    route: 'pay.stats.ar-details.by-month',
    args,
  });
}

export function getAppConfig() {
  return RSocket.rr({
    route: 'dicts.mzd.appConfigs.items.themes',
    token: '',
  });
}

const base = 'cbv.aux.excel.order.quantity';

// eslint-disable-next-line no-shadow
export function search({ pg, search }) {
  return RSocket.rs({
    route: `${base}`,
    args: {
      pg: { ...pg },
      search: {
        ...search,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function count({ search }) {
  return RSocket.rr({
    route: `${base}.count`,
    args: {
      search: {
        ...search,
      },
    },
  });
}

export function memberCount(args) {
  return RSocket.rr({
    route: 'cbv.aux.member.search.count',
    args: {
      search: {
        ...args,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function orderCount({ search, pg }) {
  return RSocket.rs({
    route: 'cbv.aux.excel.order.quantity',
    args: {
      search,
      pg,
    },
  });
}

export function orderGraph(args) {
  return RSocket.rs({
    route: 'cbv.aux.order.graph',
    args: {
      ...args,
    },
  });
}

// eslint-disable-next-line no-shadow
export function orderTotal({ search }) {
  return RSocket.rr({
    route: 'cbv.aux.excel.order.quantity.statistics',
    args: {
      search,
    },
  });
}

export function pointTrade(args) {
  return RSocket.rr({
    route: 'cbv.aux.point.trade.statistics',
    args: {
      ...args,
    },
  });
}
